/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package app.ernesto.modelo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author ernesto
 */
@Entity
@Table(name = "INVESTIGADOR", catalog = "", schema = "OWN_PROYECTO")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Investigador.findAll", query = "SELECT i FROM Investigador i"),
    @NamedQuery(name = "Investigador.findByDniInvestigador", query = "SELECT i FROM Investigador i WHERE i.dniInvestigador = :dniInvestigador"),
    @NamedQuery(name = "Investigador.findByNombre", query = "SELECT i FROM Investigador i WHERE i.nombre = :nombre"),
    @NamedQuery(name = "Investigador.findByTelefono", query = "SELECT i FROM Investigador i WHERE i.telefono = :telefono"),
    @NamedQuery(name = "Investigador.findByCiudad", query = "SELECT i FROM Investigador i WHERE i.ciudad = :ciudad")})
public class Investigador implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "DNI_INVESTIGADOR", nullable = false, length = 100)
    private String dniInvestigador;
    @Size(max = 100)
    @Column(name = "NOMBRE", length = 100)
    private String nombre;
    @Size(max = 100)
    @Column(name = "TELEFONO", length = 100)
    private String telefono;
    @Size(max = 100)
    @Column(name = "CIUDAD", length = 100)
    private String ciudad;

    public Investigador() {
    }

    public Investigador(String dniInvestigador) {
        this.dniInvestigador = dniInvestigador;
    }

    public String getDniInvestigador() {
        return dniInvestigador;
    }

    public void setDniInvestigador(String dniInvestigador) {
        this.dniInvestigador = dniInvestigador;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getTelefono() {
        return telefono;
    }

    public void setTelefono(String telefono) {
        this.telefono = telefono;
    }

    public String getCiudad() {
        return ciudad;
    }

    public void setCiudad(String ciudad) {
        this.ciudad = ciudad;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (dniInvestigador != null ? dniInvestigador.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Investigador)) {
            return false;
        }
        Investigador other = (Investigador) object;
        if ((this.dniInvestigador == null && other.dniInvestigador != null) || (this.dniInvestigador != null && !this.dniInvestigador.equals(other.dniInvestigador))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "app.ernesto.modelo.Investigador[ dniInvestigador=" + dniInvestigador + " ]";
    }
    
}
